package cn.wolfcode.wolf2w.advice;

import cn.wolfcode.wolf2w.exception.LogicException;
import cn.wolfcode.wolf2w.util.JsonResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import static cn.wolfcode.wolf2w.util.JsonResult.CODE_ERROR_PARAM;

@ControllerAdvice
public class MgrsiteExceptionHandler{

    /*@ExceptionHandler(LogicException.class)
    @ResponseBody
    public JsonResult logicHandler(LogicException lg){
        lg.printStackTrace();
        return new JsonResult(CODE_ERROR_PARAM,lg.getMessage(),null);
    }

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public JsonResult exceptionHandler(LogicException lg){
        lg.printStackTrace();
        return JsonResult.defaultError();
    }*/
}
